{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "public class EasyFormData {\n",
    "    static EasyForm f2;\n",
    "    static EasyForm[] arr;\n",
    "    static {\n",
    "        arr = new EasyForm[20];\n",
    "        for(int i = 0; i < 20; i++){\n",
    "            arr[i] = new EasyForm(\"form\" + i);\n",
    "        }\n",
    "    }\n",
    "    public static EasyForm getEasyForm(int i){\n",
    "        return arr[i];\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(0);\n",
    "EasyFormData.getEasyForm(0);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(1).addTextField(\"field name\");\n",
    "EasyFormData.getEasyForm(1);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(1).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(1).put(\"field name\", \"1text from code1\");\n",
    "EasyFormData.getEasyForm(1).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(2).addTextField(\"field name\", 10);\n",
    "EasyFormData.getEasyForm(2);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(3).addTextArea(\"field name\");\n",
    "EasyFormData.getEasyForm(3);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(3).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(3).put(\"field name\", \"3text from code3\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(4).addTextArea(\"field name\", 20, 5);\n",
    "EasyFormData.getEasyForm(4);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(5).addTextArea(\"field name\", \"5initial value5\");\n",
    "EasyFormData.getEasyForm(5);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(6).addCheckBox(\"field name\");\n",
    "EasyFormData.getEasyForm(6);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(6).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(6).put(\"field name\", \"false\");\n",
    "EasyFormData.getEasyForm(6).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(7).addCheckBox(\"field name\", Boolean.TRUE);\n",
    "EasyFormData.getEasyForm(7);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(8).addComboBox(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"));\n",
    "EasyFormData.getEasyForm(8);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(8).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(8).put(\"field name\", \"three\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(9).addList(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"));\n",
    "EasyFormData.getEasyForm(9);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(9).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(9).put(\"field name\", Arrays.asList(\"one\"));"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(10).addList(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"), Boolean.FALSE);\n",
    "EasyFormData.getEasyForm(10);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(10).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(11).addList(\"field name\", Arrays.asList(\"one\", \"two\", \"three\", \"four\"), 2);\n",
    "EasyFormData.getEasyForm(11);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(12).addCheckBoxes(\"field name\", Arrays.asList(\"one\", \"two\", \"three\", \"four\"));\n",
    "EasyFormData.getEasyForm(12);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(12).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(12).put(\"field name\", Arrays.asList(\"one\"));"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(13).addCheckBoxes(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"),  EasyForm.HORIZONTAL);\n",
    "EasyFormData.getEasyForm(13);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(14).addRadioButtons(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"));\n",
    "EasyFormData.getEasyForm(14);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(14).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(14).put(\"field name\", \"three\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import java.util.Arrays;\n",
    "\n",
    "EasyFormData.getEasyForm(15).addRadioButtons(\"field name\", Arrays.asList(\"one\", \"two\", \"three\"),  EasyForm.HORIZONTAL);\n",
    "EasyFormData.getEasyForm(15);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(16).addDatePicker(\"field name\");\n",
    "EasyFormData.getEasyForm(16);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(16).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(16).put(\"field name\", \"20170527\");\n",
    "EasyFormData.getEasyForm(16).get(\"field name\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.easyform.formitem.widgets.ButtonComponentWidget;\n",
    "\n",
    "EasyFormData.getEasyForm(17).addButton(\"run tag\", \"tag1\");\n",
    "ButtonComponentWidget button18 = EasyFormData.getEasyForm(17).addButton(\"actionPerformed\");\n",
    "button18.actionPerformed = text -> EasyFormData.getEasyForm(18).put(\"field4\", \"from actionPerformed\");\n",
    "\n",
    "EasyFormData.getEasyForm(17);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(18).put(\"field2\", \"test text\");\n",
    "EasyFormData.getEasyForm(18).get(\"field2\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "tag1"
    ]
   },
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(18).addTextField(\"field1\").onInit( text ->  EasyFormData.getEasyForm(18).put(\"field1\", \"from onInit\"));\n",
    "EasyFormData.getEasyForm(18).addTextField(\"field2\").onChange( text -> EasyFormData.getEasyForm(18).put(\"field3\", text + \" from onChange\"));\n",
    "EasyFormData.getEasyForm(18).addTextField(\"field3\");\n",
    "EasyFormData.getEasyForm(18).addTextField(\"field4\");\n",
    "EasyFormData.getEasyForm(18);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider;\n",
    "\n",
    "IntSlider w = new IntSlider();\n",
    "w.setValue(50);\n",
    "\n",
    "EasyFormData.getEasyForm(19).addWidget(\"slider19\", w);\n",
    "EasyFormData.getEasyForm(19);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EasyFormData.getEasyForm(19).get(\"slider19\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Java11",
   "language": "java",
   "name": "java11"
  },
  "language_info": {
   "codemirror_mode": "text/x-java",
   "file_extension": ".java",
   "mimetype": "",
   "name": "Java11",
   "nbconverter_exporter": "",
   "version": "11.0.1-internal"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
